package com.icreate.storm.methods.indicators.fieldCreater;

import com.icreate.entity.indicator.IndicatorID;
import com.icreate.entity.indicator.S1_MMEfield;
import com.icreate.entity.indicator.Uufield;
import com.icreate.storm.methods.common.DateMethod;

/**
 * Created by icreate on 2017/5/21.
 */
public class UufieldCreater extends BaseSubstring implements FieldCreater<Uufield> {
    private int[] indexsBuffer=new int[17];
    @Override
    protected int[] getIndexBuffer() {
        return indexsBuffer;
    }
    public Uufield create(String s) {
     /*
        String[] cells = s.split(",");
        String ts = cells[10];
        String cellid = cells[16];
        String imsi = cells[6];
        String imei = cells[7];
        if (ts.equals("") || cellid.equals("") || imsi.equals(""))
            return null;
        String hour = DateMethod.getHour(ts);
        Uufield uufield = new Uufield(DateMethod.getDate(ts), cellid, imsi, imei, hour);
        uufield.setStatus(cells[13]);
        uufield.setProcedureType(cells[9]);
        */
        setSplitIndexes(s);
        String ts =  getCell(10); //cells[10];
        String cellid =  getCell(16); //cells[16];
        String imsi =  getCell(6); //cells[6];
        String imei =  getCell(7); //cells[7];
        if (ts.equals("") || cellid.equals("") || imsi.equals(""))
            return null;
        String hour = DateMethod.getHour(ts);
        Uufield uufield = new Uufield(DateMethod.getDate(ts), cellid, imsi, imei, hour);
        uufield.setStatus( getCell(13));
        uufield.setProcedureType( getCell(9));
        return uufield;
    }

}
